Rendering VoxelsΒΆ
Guerilla Render renders voxel from Maya Fluid and OpenVDB fluids.
Using Maya Fluids
Guerilla can render Maya Fluids (only the 3d ones) as regular volumes.
The Maya fluids are exported from Maya using the Guerilla Render plug-in as any other objects. Once in Guerilla, assign the Volume shader to the fluid object using the RenderGraph as usual and set the voxel attributes (like density, temperature, fuel) in the shader as explained below.
Here are the Maya Fluids attributes available in Guerilla Render : "color", "coordinates", "density", "fallof", "fuel", "pressure", "temperature", "velocity"
Using OpenVDB
Drag'n drop the OpenVDB file in a Guerilla viewport (or open it with "Create Reference"). This will add a reference on the OpenVDB file. Assign the Volume shader to the fluid object using the RenderGraph as usual and set the voxel attributes (like density, temperature, fuel) in the shader as explained below.
If you have a sequence of openvdb files replace the sequence number in "Object -> Geometry -> Geometry Filename" by the matching pattern :
Filename | Pattern |
---|---|
explosion1.vdb | explosion$f.vdb |
explosion01.vdb | explosion$02f.vdb |
explosion001.vdb | explosion$03f.vdb |
explosion0001.vdb | explosion$04f.vdb |
Setup the voxel density
Using the RenderGraph, add a
On the Volume -> Density attribute, press the M button and select the Voxel sub-shader.
Select the voxel channel for the density ("density" should work for Maya Fluids and some OpenVDB fluids).
Tweak the density range using the Voxel -> Range -> OutMin/OutMax attributes.
Setup the voxel ray marching
The voxel is looking blocky here because the ray marching step is too big.
We add an
Rendering a voxel with motion blur
If the voxel includes a velocity channel, Guerilla renders the voxel with motion blur. Adjust the amount of motion blur using the
Adding noise to a voxel
Let's add some noise in the voxel Density.
- In the RenderGraph, select the volume node with the Voxel sub-shader.
- Set the Voxel -> Noise -> Octaves attribute to 1.
- Increase the Voxel -> Noise -> Intensity attribute till you got see some displacement in the voxel.
- Tweak the Voxel -> Noise -> Scale attribute to adjust the noise base frequency.
- Then increase the Voxel -> Noise -> Octaves attribute to add noise details.
If your voxel have texture coordinates (Maya generates those coordinates if you turn in Maya the
Noise using the texture coordinates
- In the RenderGraph, select the volume node with the Voxel sub-shader.
- Check the Voxel -> Noise -> Grid Coordinates attribute.
- Set the Voxel -> Noise -> Octaves attribute to 1.
- Increase the Voxel -> Noise -> Intensity attribute till you got see some displacement in the voxel.
- Tweak the Voxel -> Noise -> Scale attribute to adjust the noise base frequency.
- Then increase the Voxel -> Noise -> Octaves attribute to add noise details.
Setup the voxel temperature
Follow the same instructions as the density, but on the Volume -> Black Body -> Temperature attribute. Choose the correct voxel channel for the temperature ("temperature" should work for Maya Fluids and some OpenVDB fluids).
Tweak the density range using the Voxel -> Range -> OutMin/OutMax attributes. You may have to use a OutMax around 1000 or 2000 (Kelvin degrees). Tweak Volume -> Black Body -> Intensity to get the final incandescence.
Setup a voxel with a color gradient
Let's control the Volume Incandescence attribute with the Maya fluid "fuel" attribute.
Create first a sub-shading network for the Volume -> Incandescence attribute. To do that, drag'n drop the Incandescence Attribute in a viewport. It will create a new shading network for this attribute.
In this new shading network, add a Voxel node (in the library : "Attributes -> Voxel") and a Gradient node (Node Picker and tip "gradient" and select "texture/Gradient").
Create the shading network. The Volume -> Incandescence attribute is now controlled by the voxel's fuel channel through a custom color gradient.